package com.dobby.spring.data.jpa.repository;

import com.dobby.spring.data.jpa.domain.Customer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

/**
 * Customer 管理仓库
 * Created by jonas on 2017/9/5.
 */
public interface CustomerRepository extends JpaRepository<Customer, Long> {


    /**
     * 根据 lastName 分页查询 Customer
     * @param lastName
     * @param pageable
     * @return
     */
    Page<Customer> findByLastName(String lastName, Pageable pageable);

    /**
     * 根据 code 查询
     * @param code
     * @return
     */
    Customer findByCode(String code);


}
